// 首页-广告区域接口
// 广告展示位置: 1为首页(默认值) 2为商品分类页
import type { BannerItem, CategoryItem, HotItem, GuessItem } from "@/types/home"
import { http } from "@/utils/http"
import type { PageParams, PageResult } from "@/types/global"

export const getHomeBannerAPI = (distributionSite = 1) => {
    return http<BannerItem[]>({
        method: 'GET',
        url: '/home/banner',
        data: {
            distributionSite
        }
    })
}

// 首页-前台分类区域接口
export const getHomeCategoryAPI = () => {
    return http<CategoryItem[]>({
        method: 'GET',
        url: '/home/category/mutli'
    })
}

// 首页-热门推荐区域接口
export const getHomeHotAPI = () => {
    return http<HotItem[]>({
        method: 'GET',
        url: '/home/hot/mutli'
    })
}

// 首页-猜你喜欢区域接口
export const getHomeGoodsGuessLikeAPI = (data?: PageParams) => {
    return http<PageResult<GuessItem>>({
        method: 'GET',
        url: '/home/goods/guessLike',
        data
    })
}